<?php


class Core_Table_Mail_Queue extends Database_Table
{
	/**
	 * @var string
	 */
	protected $_name = 'core_mail_queue';

	/**
	 * @var string
	 */
	protected $_rowClass = 'Core_Table_Model_Mail_Queue';

	/**
	 * @param array $data
	 * @return Mail_Table_Model_Queue
	 */
	function addItem($data)
	{
		$item = $this -> fetchNew();

		if (isset($data['queue_id']))
		{
			unset($data['queue_id']);
		}

		$item -> fromArray($data);

		$item -> extra = serialize($data);

		$item -> created_at = time();

		$item -> save();

		return $item;
	}

}
